<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>搜索页</title>
    <link rel="stylesheet" href="__PUBLIC__/Mobile/css/zhanghou.css">
    <script src="__PUBLIC__/Mobile/js/jquery-1.9.1.js"></script>
    <script src="__PUBLIC__/Mobile/layer/layer.min.js"></script>

</head>

<body>
<section>
<div class="return" style="position:fixed; top:0; width:100%;">
        <a href="javascript:history.back(-1);"  style="height:30px; line-height:30px;">
        <img src="__PUBLIC__/Mobile/images/cls_left1s.png" style="height:25px; line-height:25px;padding-top:3%; width:4%;padding-right:5%; padding-left:2%;">
        </a>
        <span>
            <form method="get" action="{:U('Index/goods_search')}" onsubmit="return check();">
                <div class="search1" style="overflow: hidden; position:relative;top:5px;width:80%;">
                    <button type="submit" style="float: left;  border: none; outline: none; width: 8%;margin-top:2%;margin-left:1%; background: #ffffff; "></button>
                    <input name="title" type="text" id="title" value="" placeholder="{$_GET['name']}">
                    <input name="type" type="text" id="title" value="{$_GET['type']}">
                </div>
            </form>
        </span>
</div>

<!-- <div class="return" style="position:fixed; top:0; width:100%;">

        <span>
            <form method="post" action="{:U('Index/goods_search')}" onsubmit="return check();">
                <div class="search1" style="overflow: hidden; position:relative;top:5px;">
                    <button type="submit" style="float: left;  border: none; outline: none; width: 8%;margin-top:2%;margin-left:1%; background: #ffffff; "></button>
                    <input name="title" type="text" id="title" value="" placeholder="{$_GET['name']}">
                </div>
            </form>


        </span>

</div> -->
<div style="height:100px; line-height:50px;"></div>

<form action="__SELF__" method="GET">
<p style="text-align:center; font-size:16px; height:40px; background: #FFF; line-height:40px; position:fixed; top:49px; width:100%">
{$_GET['name']} &nbsp;
<input name="sign" type="hidden" value="{$class_fid}">
<input name="name" type="hidden" value="{$_GET['name']}">
<input name="type" type="hidden" value="{$type}">
<select name="class_id" id="select">
    <option value="">-------------</option>
    <foreach name="result_class" item="vo_class">
        <option value="{$vo_class.id}">{$vo_class.class_name}</option>
    </foreach>
</select>
<!-- <input type="submit" value="搜 索" style="padding:3px 15px;" /> -->
</p>
</form>
 <script>
        $(function(){
            $('#select').change(function(){
                var id = $('#select').val();
                $.ajax({
                    data:"id="+id,
                    type:"POST",
                    url:"{:U('Index/ajax_goods')}",
                    success:function(msg){
                        console.log(msg);
                        if(msg == 0){
//                          parent.layer.msg('没有商品！',{icon:2,time:2000});
                            var html = '<li style="text-align: center; line-height: 50px; font-size: 18px; margin-top:200px;">没有您想要的商品</li>';
                            $('.commodity').html(html);
                        }else{
                            var html = '';
                            $.each(msg,function(k,v){
                                if(v.type == 1){
                                    html += "<a href='{:U('Goods/goods_goods')}?id="+v.id+"'><img style='height:150px' src='__PUBLIC__/Uploads/goods/"+v.pic_url+"'><p>"+v.title.substring(0,12)+"...</p><p><span class='Orange left size18'>￥"+v.price_new+"</span></p></a>";
                                }else{
                                    html += "<a href='{:U('Goods/goods_goods')}?id="+v.id+"'><img style='height:150px' src='__PUBLIC__/Uploads/goods/"+v.pic_url+"'><p>"+v.title.substring(0,12)+"...</p><p><span class='Orange left size18'>￥"+v.price_new+"</span></p></a>";
                                }

                            });
                            $('.commodity').html(html);
                        }
                    }
                });
            });
        })
    </script>

    <div class="commodity" style="margin-bottom:13%">
        <ul>
            <if condition="$count eq 0">
                <li style="text-align: center; line-height: 50px; font-size: 18px; margin-top:200px;">没有您想要的商品</li>
                <else />
            <foreach name="list" item="vo" key="k">
                <if condition="$_GET['type']==1">
    				<a style="width:46%;" href="{:U('Mobile/Goods/goods_goods',array('id'=>$vo['id']))}" style="margin-right:2%">

                        <img src="__PUBLIC__/Uploads/goods/{$vo.pic_url}" style="height: 150px" >
                        <p style="height:35px;"><?php echo utf8sub($vo['title'],26);?>...</p>
                        <p><span class=" Orange left size18">￥{$vo.price_new}</span><!--<span class=" gray right" >1.8万件已售</span>--></p>
                    </a>
                </if>
                <if condition="$_GET['type']==2">
                    <a style="width:46%;" href="{:U('Mobile/Tourism/tourism_tourism',array('id'=>$vo['id']))}" style="margin-right:2%">

                        <img src="__PUBLIC__/Uploads/goods/{$vo.pic_url}" style="height: 150px" >
                        <p style="height:35px;"><?php echo utf8sub($vo['title'],26);?>...</p>
                        <p><span class=" Orange left size18">￥{$vo.price_new}</span><!--<span class=" gray right" >1.8万件已售</span>--></p>
                    </a>
                </if>                
            </foreach>
         </if>
        </ul>
    </div>
</section>

<include file="Public:footer" />


<!-- <div style="height:50px;"></div>
<div class="Navigation" style="position:fixed; bottom:0; width:100%;">
    <input type="button" class="Pay size18" style="width:20%; float:left; background:#FF790C; border:none;"  onClick="return_home({$resone.id})" value="首页">
    <input type="button" class="Pay size18" style="width:40%; float:left; background:#50A000; border:none;"  onClick="add_cart({$resone.id})" value="加入购物车">
    <input type="submit" class="Pay size18" style="width:40%; float:right; border:none;" value="立即购买" >
</div> -->
<script type="text/javascript">
function return_home(){
    window.location.href="{:U('Index/index')}";
}
</script>
</body>
</html>
